<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      transition: all 0.3s linear;
    }

    .main {
      width: 100%;
      height: 30px;
      background-color: #30abdb;
      box-shadow: 0 0 1px 0px #2e2a2a;
    }

    .lesser {
      width: 100%;
      height: 300px;
      background-color: #7192a0;
    }
  </style>
</head>

<body>
  <div class="main">一</div>
  <div class="lesser">一1</div>
  <div class="main">二</div>
  <div class="lesser">二2</div>
  <div class="main">三</div>
  <div class="lesser">三3</div>
  <button>123</button>
  <script>
    let mains = document.querySelectorAll('.main')
    let lessers = document.querySelectorAll('.lesser')
    function easy(i) {
      
        lessers.forEach((val) => {
          val.setAttribute('hidden', 'hidden')
        })

        lessers[i].removeAttribute('hidden')
      
    }
    // console.log(mains, lessers);
    mains.forEach((val, i) => {
      mains[i].addEventListener('click', function() {
        easy.call(null,i)
      })
        // val.addEventListener('click', function() {
        //   lessers.forEach((val) => {
        //     val.setAttribute('hidden', 'hidden')
        //   })
  
        //   lessers[i].removeAttribute('hidden')
        // })
    })
  </script>
</body>

</html>